<?php
if ($_GET['LID']) 
{
    include('lib_f_protocol.inc.php');
    include('v_global.inc.php');
    include('f_db.inc.php');
    include('f_global.inc.php');
    if ($URL = mqs("SELECT URL FROM links WHERE LID=".$_GET['LID'])) 
    {
        mq("UPDATE links SET Hits=Hits+1 WHERE LID=".$_GET['LID']);
        header('location:'.$URL);
    }
} else {
header('location:http://'.$_SERVER['HTTP_HOST']);
}
?>